import json

from flask import Flask, jsonify,request,g,Response
import re, requests
import json

from nameMain import getNameResouce
app = Flask(__name__)


@app.route('/',methods=['GET'])
def index():
    # 接收查询参数
    param = request.args.get('param', default=None, type=str)
    # 返回参数和消息
    #return f'Received param: {param}'
    return f"Hello, World!{param}"



@app.route('/qryNameSource', methods=['POST'])
def qryNameSource():
    data = request.json
    name = data.get('name')
    #print(dateType)
    rs= getNameResouce(name)
    return jsonify(rs)



if __name__ == '__main__':
    app.run(debug=True)